package com.magic.gre.ui.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;

import com.magic.gre.R;
import com.magic.gre.base.activity.BaseCenterActivity;
import com.magic.gre.helper.Apphelper;
import com.magic.gre.ui.dialog.ClearHintDialog;
import com.noname.lib_base_java.util.DataCleanManager;

import butterknife.OnClick;

/**
 * Author: Lmoumou
 * Date: 2019-01-10 11:43
 * 文件名: SystemSettingActivity
 * 描述:
 */
public class SystemSettingActivity extends BaseCenterActivity {

    public static void startThis(Context context) {
        Intent intent = new Intent(context.getApplicationContext(), SystemSettingActivity.class);
        context.startActivity(intent);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_system_setting;
    }

    @Override
    protected void initView(@Nullable Bundle savedInstanceState) {

    }

    @OnClick(value = {R.id.exit_bt, R.id.suggestion_tv, R.id.clear_tv, R.id.modify_pswd_tv,R.id.msg_tv})
    protected void onClick(View view) {
        switch (view.getId()) {
            case R.id.exit_bt:
                Apphelper.removeAll();
                LoginActivity.startThis(this);
                finish();
                break;
            case R.id.suggestion_tv:
                SuggestionActvity.startThis(this);
                break;
            case R.id.clear_tv:
                DataCleanManager.clearAllCache(this);
                ClearHintDialog dialog = new ClearHintDialog();
                dialog.showThis(getSupportFragmentManager(), ClearHintDialog.class.getSimpleName());
                break;
            case R.id.modify_pswd_tv:
                SetModifyPwsdActivity.startThis(this);
                break;
            case R.id.msg_tv:
                MyMsgActivity.startThis(this);
                break;
        }
    }
}
